package cn.alex.sso.client.demo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author Alex
 * @date 2025/1/9 下午1:41
 */
@Component
public class LscConfig {
    public static String APP_ID;
    public static String APP_SECRET_KEY;
    public static String SERVER_URL;
    public static String LOGOUT_CALL_URL;
    public static String AUTH_URL;
    public static String CHECK_TICKET_URL;
    public static String LOGOUT_URL;


    @Value("${lc-sso.appId}")
    public void setAppId(String appId) {
        APP_ID = appId;
    }

    @Value("${lc-sso.appSecretKey}")
    public void setAppSecretKey(String appSecretKey) {
        APP_SECRET_KEY = appSecretKey;
    }

    @Value("${lc-sso.serverUrl}")
    public void setServerUrl(String serverUrl) {
        SERVER_URL = serverUrl;
        AUTH_URL = SERVER_URL + "/sso/auth";
        CHECK_TICKET_URL = SERVER_URL + "/sso/checkTicket";
        LOGOUT_URL = SERVER_URL + "/sso/signout";
    }

    @Value("${lc-sso.logoutCallUrl}")
    public void setLogoutCallUrl(String logoutCallUrl) {
        LOGOUT_CALL_URL = logoutCallUrl;
    }
}
